home *** CD-ROM | disk | FTP | other *** search
- On 13 Mar 1998, Jonas Thorell wrote:
-
- > Garfield Benjamin (gbenjam@sosbbs.com) wrote:
- >
- > >> If AGE<10
- > >> Print "You are less than 10 years old."
- > >> else if AGE=21
- > >> Print "Hey!! Now you can drink alcohol in the U.S.!!"
- > >> else
- > >> Print "WOW, you're OVER 21!!"
- > >> endif
- > >> Smallest, and tidiest in my humble opinion.
- > >> Is my approach good enough in the meantime?
- >
- > > Well, problem is this won't work.
- >
- > Yes it will. I tried it.
- >
- > >First, you need to match every If with an End If and second, the logic is not
- > >the same.
- >
- > Both. If and endif is coupled the same way as select ... case ... endselect
- > is so I can't see the problem. The logic is the same too. Select..is just
- > more advanced in that it offers some extra features.
- >
- > >If AGE<10
- > > Print "You are less than 10 years old."
- > >Else If AGE=21
- > > Print"Hey!! Now you can drink alcohol in the U.S.!!"
- > > Else If AGE>21
- > > Print "WOW, you'r OVER 21!!"
- > > End If
- > > End If
- > >End If
- >
- > That would trigger the error-system. One if and three end-ifs is plain
- > wrong.
- >
- > > That being said, this might be a bit clearer (arguably the "best"
- > > method for AMOS) but it still lacks when compared to the
- > > Select...Case style. Anyway, the point is you are still looking at
- > > the same two basic methods, the If...End If and the If...Else...EndIf
- >
- > Yes but does it really matter? The result is what is importand and the
- >
- > if...
- >
- > else if ...
- >
- > else
- >
- > end if
- >
- > structure is quite close to the select.. syntax.
- >
- Hi, I just got to my email after a few weeks off and this is near the
- top of the bundle ... It's probably answered later on tho...
- Didn't one of the updates to Amos/Pro fix the Elseif etc prob? So
- although messy some older versions can only use the Second approach. I
- remember this change cos at the time I thought that Amos code
- sometimes looked ridiculous with all the indenting.....
-
- ### ### ######## ########### ###########
- #### #### ### ### ### ###
- ##!## ##!## #!# #!# #!# #!#
- !#! #!#!# !@! !@!!@@!!@! !@! !@! mattw@netsoc.ucd.ie
- !!! ! !!! !!! !!! !!! !!! x x
- :!: :!: :!: :!: :!: :!: \__/
- ::: ::: ::: ::: ::: :::
- :: :: :: :: : :
-
-
-